home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / oop_tp55.zip / LIST4_2.PAS < prev    next >
Pascal/Delphi Source File  |  1990-01-09  |  1KB  |  54 lines

  1. program Listing4-2;
  2.  
  3. uses Graph, Crt, PlotData;
  4.  
  5. var
  6.    Plot1 : Plot;
  7.    LB, RB, TB, BB : integer;
  8.    GraphDriver, GraphMode : integer;
  9.    i : integer;
  10.    tmp : real;
  11.  
  12. begin
  13.  
  14.      GraphDriver := Detect;
  15.      InitGraph( GraphDriver, GraphMode, '' );
  16.      Graph.SetColor( white );
  17.  
  18.      { border of 50 }
  19.      LB := 50;
  20.      RB := GetMaxX - LB;
  21.      TB := 50;
  22.      BB := GetMaxY - TB;
  23.  
  24.      Plot1.Init( 0, 90, 1, 0, 11, 1000, LB, RB, TB, BB, 1, 1, 1, 1,
  25.                        'Pump Performance Curve',
  26.                        'Flow, gpm (x 1000)', 'Pressure, psi' , false);
  27.      Plot1.DrawVGridLine( 9000 );
  28.      Plot1.DrawVGridLine( 4000 );
  29.      Plot1.DrawHGridLine( 75 );
  30.      Plot1.DrawHGridLine( 60 );
  31.      Plot1.PlaceXAxisValue( 9000 );
  32.      Plot1.PlaceXAxisvalue( 4000 );
  33.      Plot1.PlaceYAxisValue( 60 );
  34.      Plot1.PlaceYAxisValue( 75 );
  35.      { done! setting up graph }
  36.      for i := 0 to 70 do
  37.          begin
  38.          { plot
  39.                pressure = MaxPressure - K * Flow ^2
  40.            where
  41.                MaxPressure = 78.7
  42.                K = 2.3 e -7
  43.          }
  44.          tmp := 3000+(100*i);
  45.          Plot1.AddPoint( tmp, 78.7-(tmp*tmp*2.3e-7) );
  46.          end;
  47.  
  48.      repeat until KeyPressed;
  49.  
  50.      RestoreCRTMode;
  51. end.
  52.  
  53.  
  54.